package edu.utdallas.cs.securechat.main;

import java.io.Serializable;
import java.net.InetAddress;
import java.security.Key;
import java.util.Arrays;
import java.util.Vector;

public class Message implements Serializable{
	private static final long serialVersionUID = 1L;
	String operation;
	String username;
	InetAddress address;
	byte[] data;
	Key key = null;
	String statusMessage;
	Vector<String> onlineUsers = new Vector<String>();
	boolean operationStatus;
	
	public Message(String operation){
		this.operation = operation;
		username = null;
	}
	
	public String getOperation(){
		return operation;
	}
	
	public void setOperation(String operation){
		this.operation = operation;
	}
	
	public String getUsername(){
		return username;
	}
	
	public void setUsername(String username){
		this.username = username;
	}
	
	public byte[] getData(){
		return data;
	}
	
	public void setData(byte[] data){
		this.data = data;
	}
	
	public void setAddress(InetAddress address){
		this.address = address;
	}
	
	public InetAddress getAddress(){
		return this.address;
	}
	
	public Key getKey(){
		return key;
	}
	
	public void setKey(Key key){
		this.key = key;
	}
	
	public String getStatusMessage(){
		return statusMessage;
	}
	
	public void setStatusMessage(String errorMessage){
		this.statusMessage = errorMessage;
	}
	
	public Vector<String> getOnlineUsers() {
		return onlineUsers;
	}

	public void setOnlineUsers(Vector<String> usersonline) {
		this.onlineUsers = usersonline;
	}

	public boolean getOperationStatus(){
		return operationStatus;
	}
	
	public void setOperationStatus(boolean operationStatus){
		this.operationStatus = operationStatus;
	}

	@Override
	public String toString() {
		return "Message [operation=" + operation + ", username=" + username + ", data="
				+ Arrays.toString(data) + ", key=" + key + ", statusMessage=" + statusMessage
				+ ", onlineUsers=" + onlineUsers + ", operationStatus=" + operationStatus + "]";
	}
}
